<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserCountsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_counts', function (Blueprint $table) {
            $table->integer('user_id')->comment('外键');
            $table->integer('content_count')->comment('发布内容量')->default(0);
            $table->integer('comment_count')->comment('发表评论量')->default(0);
            $table->integer('today_content_count')->comment('今日内容量')->default(0);
            $table->integer('today_comment_count')->comment('今日评论量')->default(0);
            $table->integer('view_count')->comment('浏览内容量')->default(0);
            $table->integer('today_view_count')->comment('今日浏览量')->default(0);
            $table->integer('trend_count')->comment('动态量')->default(0);
            $table->integer('today_trend_count')->comment('今日动态量')->default(0);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_counts');
    }
}
